// import axios from "axios"
export default {
    name: "Change",
    data() {
        return {
               username: "",
               password: "",
               code: "",
    };
},
    methods: {
      to_sign_in(){
        this.$emit('Login_status',true,false,false)
    },
        Verifications() {
            this.$axios({
                method: "GET",
                url: "/api/send",
                params: {
                  phone: this.username,
                },
              })
               // 成功
        .then((res) => {
            console.log(res.data);
          })
          // 失败
          .catch((err) => {
            console.error(err);
          });
      },
       // 手机修改
    registerFuns() {
        this.$axios({
          method: "POST",
          url: "/api/forgetPassword",
          params: {
            username: this.username,
            password: this.password,
            code: this.code,
          },
        })
          // 成功
          .then((res) => {
            console.log(res.data);
            alert(res.data.msg);
          })
          // 失败
          .catch((err) => {
            console.error(err);
          });
          (this.username = ""), (this.password = ""),(this.code);
          alert("修改成功")
          this.$emit('SignInShow')
      },
    },
  };

            
             
        
           
            // (this.urseName = ""), (this.password = "");
            // alert("修改成功")
            // this.$emit('SignInShow')
        
